new Vue({
    el:"#app",
    data:{
        name:"",
        age:"30"
    },
    methods:{
        showName: function(){
            //this.$refs.name为标签中ref="name"标记的对象
            console.log("输入姓名:"+this.$refs.name.value);
            this.name = this.$refs.name.value;
        }
    }
});